package com.mikao.dao;

import com.mikao.entity.Orders;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

public interface OrderDao extends JpaRepository<Orders, Long>, JpaSpecificationExecutor {

    /**
     * 找到待收货的订单
     *
     * @param userId  id
     * @param goodsId ID
     * @param type    转台
     * @return order
     */
    Orders findAllByUserIdAndGoodsIdAndTypeOrderByCreateTimeDesc(Long userId, Long goodsId, Integer type);
}
